@using MvcApplication1.Controllers
@using MvcApplication1.Models

@helper AJsUpdateGrid(string url, string gridContainerId, RFunc orderBy, RFunc header)
{
    <a href="javascript:updateGrid('@url', '@gridContainerId', '@orderBy(new RVoid())')">@header(new RVoid())</a>
}

@helper AJsUpdateGrid(ClickableColumnInfo info, RFunc orderBy, RFunc header)
{ @AJsUpdateGrid(info.Url, info.GridContainerId, orderBy, header) }

@helper CreateGrid(IGenericGridArg arg, RFunc style)
{
    <table border="1" @style(new RVoid())>
        <tr>
            @foreach (var column in arg.Columns)
            {
                <th>@column.Th(new RVoid())</th>
            }
        </tr>
        @foreach (var item in arg.DataItems)
        {
            <tr>
                @foreach (var column in item.Columns)
                {
                    <td>@column.Td(new RVoid())</td>
                }
            </tr>
        }
    </table>
    @DateTime.Now
}